package cn.iocoder.yudao.module.crossborder.enums;

import cn.iocoder.yudao.framework.common.core.ArrayValuable;
import lombok.Getter;
import lombok.RequiredArgsConstructor;

import java.util.Arrays;

/**
 * 跨境电商货币枚举
 *
 * @author LHL
 */
@RequiredArgsConstructor
@Getter
public enum CrossBorderCurrencyEnum implements ArrayValuable<String> {

    CNY("CNY", "人民币", "¥", 2),
    USD("USD", "美元", "$", 2),
    EUR("EUR", "欧元", "€", 2),
    GBP("GBP", "英镑", "£", 2),
    JPY("JPY", "日元", "¥", 0),
    KRW("KRW", "韩元", "₩", 0),
    AUD("AUD", "澳元", "A$", 2),
    CAD("CAD", "加元", "C$", 2),
    CHF("CHF", "瑞士法郎", "CHF", 2),
    HKD("HKD", "港币", "HK$", 2),
    SGD("SGD", "新加坡元", "S$", 2),
    THB("THB", "泰铢", "฿", 2),
    MYR("MYR", "马来西亚林吉特", "RM", 2),
    INR("INR", "印度卢比", "₹", 2),
    BRL("BRL", "巴西雷亚尔", "R$", 2),
    MXN("MXN", "墨西哥比索", "$", 2),
    RUB("RUB", "俄罗斯卢布", "₽", 2);

    public static final String[] ARRAYS = Arrays.stream(values()).map(CrossBorderCurrencyEnum::getCode).toArray(String[]::new);

    /**
     * 货币代码
     */
    private final String code;
    /**
     * 货币名称
     */
    private final String name;
    /**
     * 货币符号
     */
    private final String symbol;
    /**
     * 小数位数
     */
    private final Integer decimalPlaces;

    @Override
    public String[] array() {
        return ARRAYS;
    }

}
